import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login'
import Register from '@/components/register'
import Main from '@/components/main'
import History from '@/components/left/history'
import Friend from '@/components/left/friend'
import Group from '@/components/left/group'
import Circle from '@/components/left/circle'
import My from '@/components/left/my'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      children: [
        {
          path: 'history',
          name: 'history',
          component: History
        },
        {
          path: 'friends',
          name: 'friends',
          component: Friend
        },
        {
          path: 'groups',
          name: 'groups',
          component: Group
        },
        {
          path: 'circle',
          name: 'circle',
          component: Circle
        },
        {
          path: 'my',
          name: 'my',
          component: My
        }
      ]
    },
    {
      path: '/',
      name: 'main-default',
      // component: Main
      component: Login
    }
  ]
})
